package com.kuang.controller;

import com.kuang.common.anno.checkadminlogin.annotation.CheckAdminLogin;
import com.kuang.entity.Banner;
import com.kuang.service.banner.BannerServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class BannerController extends BaseController {

    @Autowired
    private BannerServiceImpl bannerService;


    @GetMapping("/banner/list")
  //  @IgnoreToken
   @CheckAdminLogin(value = "admin")
    public List<Banner> findBanners(@RequestParam(name = "pageNo", required = false, defaultValue = "1")
                                          int pageNo,
                                  @RequestParam(name = "pageSize", required = false, defaultValue = "6")
                                          int pageSize) {
        return bannerService.findBanners(pageNo, pageSize);
        //   return null;
    }


}
